package com.bjpowernode.boss.convert;

import com.bjpowernode.boss.mvc.models.vo.UserInfoVo;
import com.bjpowernode.boss.mvc.models.vo.UserShopNameVo;
import com.bjpowernode.boss.persist.domain.UserInfo;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.MappingConstants;
import org.mapstruct.Mappings;

import java.util.List;

@Mapper(componentModel = MappingConstants.ComponentModel.SPRING,
        uses = {CommonFun.class})
public interface UserInfoConvert {


    @Mappings({
            @Mapping(target = "createTime", source = "createTime", dateFormat = "yyyy-MM-dd HH:mm:ss"),
            @Mapping(target = "status", source = "status", qualifiedByName = "translateStatus")
    })
    UserInfoVo userInfoToUserInfoVo(UserInfo userInfo);

    List<UserInfoVo> userInfoListToUserInfoVoList(List<UserInfo> userInfoList);

    UserShopNameVo userInfoToShopNameVo(UserInfo userInfo);

    List<UserShopNameVo> userInfoListToShopNameVoList(List<UserInfo> userInfoList);
}
